<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$ngay=array('01','02','03','04','05','06','07','08','09','10','11','12','13','14','15',
'16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31');
$thang=array('01','02','03','04','05','06','07','08','09','10','11','12');
$gioitinh=array('Male','Female');
$nam=array( '1910','1911','1912','1913','1914','1915','1916','1917','1918','1919',
            '1920','1921','1922','1923','1924','1925','1926','1927','1928','1929',
            '1930','1931','1932','1933','1934','1935','1936','1937','1938','1939',
            '1940','1941','1942','1943','1944','1945','1946','1947','1948','1949',
            '1950','1951','1952','1953','1954','1955','1956','1957','1958','1959',
           '1960','1961','1962','1963','1964','1965','1966','1967','1968','1969',
           '1970','1971','1972','1973','1974','1975','1976','1977','1978','1979',
           '1980','1981','1982','1983','1984','1985','1986','1987','1988','1989',
           '1990','1991','1992','1993','1994','1995','1996','1997','1998','1999',
           '2000','2001','2002','2003','2004','2005','2006','2007','2008','2009',
           '2010','2011','2012','2013','2014','2015','2016','2017','2018','2019');
$songuoiphuthuoc=array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
$quanhe=array('1st Child','2nd Child','Father','Mother','Old Brother','Young Brother','Old Sister','Young Sister','Grand Father','Grand Mother');
?>
<form action="<?php echo base_url()?>staff/updateFamily" method="POST" name="formInsertFamily" onsubmit="return checkFormInsertFamily();">
    <table class="tablebg" cellspacing="1" align="right" width="900px" border="0">
        <tr>
            <td colspan="2" align="center" class="bar">Update information of <strong><?=$Relative?></strong>(<strong><?=$FullName?></strong>) 
                
            </td>
            <input type="hidden" name="txtFamilyID" value="<?=$Family_ID?>">
            <input type="hidden" name="txtStaffID" value="<?=$Staff_ID?>">
        </tr>
        <tr>
            <td align="left" class="row10">
                Relative
            </td>
            <td align="left" class="row12">
                <select name="txtRelative">
                <?php
                                   foreach($quanhe as $item){
                                     if($item == $Relative)
                                     echo "<option selected>$item</option>";
                                     else echo "<option>$item</option>";
                                   }
                      ?>
            </select>
            </td>
        </tr>
        <tr>
            <td align="left" class="row10">
                Full Name
            </td>
            <td align="left" class="row12">
                <input type="text" name="txtFullName" class="form" value="<?php if(isset($FullName)) echo $FullName?>">
            </td>
        </tr>
        <tr>
            <td align="left" class="row10">
                Gender
            </td>
            <td align="left" class="row12">
                <select name="txtGender">
                <?php
                                   foreach($gioitinh as $item){
                                     if($item == $Gender)
                                     echo "<option selected>$item</option>";
                                     else echo "<option>$item</option>";
                                   }
                      ?>
                </select>
            </td>
        </tr>
        <tr>
            <td align="left" class="row10">
                Birthday
            </td>
         <td align="left" class="row12">   
         <select name="txtDay">
                <?php
                                   foreach($ngay as $item){
                                     if($item == $Day)
                                     echo "<option selected>$item</option>";
                                     else echo "<option>$item</option>";
                                   }
                      ?>
            </select>
            <select name="txtMonth">
                <?php
                                   foreach($thang as $item){
                                     if($item == $Month)
                                     echo "<option selected>$item</option>";
                                     else echo "<option>$item</option>";
                                   }
                      ?>
            </select>
            <select name="txtYear">
                <?php
                                   foreach($nam as $item){
                                     if($item == $Year)
                                     echo "<option selected>$item</option>";
                                     else echo "<option>$item</option>";
                                   }
                      ?>
            </select>
        </td>
    </tr>
        <tr>
            <td align="left" class="row2" colspan="2">
                <input type="submit" name="insertfamily" id="submit" value="Save">
                <input type="reset" name="Reset" id="submit" value="Reset">
            </td>
        </tr>
        <tr>
        <td class="row1" align="center" colspan="2">
            <?php $titleback = '<img src ="'.base_url().'templates/images/icons/back.jpg" width=40 height=25 title="Back"/>';
            $back = anchor("staff/loadListFamily",$titleback);
            echo $back;?>
        </td>
    </tr>
    </table>
</form>
